package cn.ylhx.venue.mobileSearch.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.ylhx.venue.common.web.JsonResult;
import cn.ylhx.venue.mobileSearch.entity.SearchArea;
import cn.ylhx.venue.mobileSearch.service.SearchService;
import cn.ylhx.venue.site.entity.Site_Message;

@Controller
@RequestMapping("/mobile")
public class SearchController {
	@Resource
	private SearchService searchService;
	
	@RequestMapping("/index")
	public String listUI(){
		return "wechat/index";
		
	}
	@RequestMapping("/searchCity")
	@ResponseBody
	public JsonResult seachCity(){
		List<Map<Integer,String>> list=searchService.seachCity();
		System.out.println(list);
		return new JsonResult(list);
		
	}
	@RequestMapping("/searchArea")
	@ResponseBody
	public JsonResult searchArea(Integer parent_id){
		List<Map<Integer,String>> list=searchService.findAllArea(parent_id);
		System.out.println(list);
		return new JsonResult(list);
	}
	@RequestMapping("/searchForm")
	public String searchForm(SearchArea searchArea){
		List<Site_Message> list=searchService.searchSite(searchArea);
		System.out.println(list);
		return "wechat/search_list";
	}
	

}
